﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows;
using System.Collections.ObjectModel;
using System.Reflection;
using System.Windows.Input;
//using System.Windows;
using SSPharma.Model;
using SSPharma.Biz;
using DBAccess;
using SSPharma.Common;
using SSPharma.View;
using SSPharma.ViewModel;


namespace SSPharma.ViewModel
{
   
    class LapYeuCauMuaHangViewModel : ViewModelBase
    {
        #region Variables

        private MH_YeuCauMuahangHeader mh_YeuCauMuaHangHeader;
        private MH_YeuCauMuaHangLine mh_YeuCauMuaHangline;

        private ObservableCollection<MH_YeuCauMuaHangLine> mh_YeuCauMuaHangLine;

        public string _FormName;
        #endregion

        #region Constructor

        public LapYeuCauMuaHangViewModel()
        {
            ucMH_LapYeuCauMuaHang ycmh = new ucMH_LapYeuCauMuaHang();
                       
        }

        public void f_save ()
        {
            MessageBox.Show("Cannot connect to DB!");
            
        }

        #endregion

        #region Properties

        public long ID_SQ
        {
            get { return mh_YeuCauMuaHangHeader.ID_SQ; }
            set
            {
                if (value == mh_YeuCauMuaHangHeader.ID_SQ)
                    return;
                        mh_YeuCauMuaHangHeader.ID_SQ = value;
                base.OnPropertyChanged("ID_SQ");
            }
        }

        public string YeuCauMH_ID
        {
            get { return mh_YeuCauMuaHangHeader.YeuCauMH_ID; }
            set
            {
                if (value == mh_YeuCauMuaHangHeader.YeuCauMH_ID)
                    return;

                mh_YeuCauMuaHangHeader.YeuCauMH_ID = value;

                base.OnPropertyChanged("YeuCauMH_ID");
            }
        }

        public string SoChungTu
        {
            get { return mh_YeuCauMuaHangHeader.SoChungTu; }
            set
            {
                if (value == mh_YeuCauMuaHangHeader.SoChungTu)
                    return;

                mh_YeuCauMuaHangHeader.SoChungTu = value;

                base.OnPropertyChanged("SoChungTu");
            }
        }

        public DateTime NgayChungTu
        {
            get { return mh_YeuCauMuaHangHeader.NgayChungTu; }
            set
            {
                if (value == mh_YeuCauMuaHangHeader.NgayChungTu)
                    return;

                mh_YeuCauMuaHangHeader.NgayChungTu = value;

                base.OnPropertyChanged("NgayChungTu");
            }
        }
        public DateTime NgayCan
        {
            get { return mh_YeuCauMuaHangHeader.NgayCan; }
            set
            {
                if (value == mh_YeuCauMuaHangHeader.NgayCan)
                    return;

                mh_YeuCauMuaHangHeader.NgayCan = value;

                base.OnPropertyChanged("NgayCan");
            }
        }
        public string LoaiYeuCau
        {
            get { return mh_YeuCauMuaHangHeader.LoaiYeuCau; }
            set
            {
                if (value == mh_YeuCauMuaHangHeader.LoaiYeuCau)
                    return;

                mh_YeuCauMuaHangHeader.LoaiYeuCau = value;

                base.OnPropertyChanged("LoaiYeuCau");
            }
        }
        public string MaYeuCauCha
        {
            get { return mh_YeuCauMuaHangHeader.MaYeuCauCha; }
            set
            {
                if (value == mh_YeuCauMuaHangHeader.MaYeuCauCha)
                    return;

                mh_YeuCauMuaHangHeader.MaYeuCauCha = value;

                base.OnPropertyChanged("MaYeuCauCha");
            }
        }
        public string MaNhanVien
        {
            get { return mh_YeuCauMuaHangHeader.MaNhanVien; }
            set
            {
                if (value == mh_YeuCauMuaHangHeader.MaNhanVien)
                    return;

                mh_YeuCauMuaHangHeader.MaNhanVien = value;

                base.OnPropertyChanged("MaNhanVien");
            }
        }
        public string GhiChu
        {
            get { return mh_YeuCauMuaHangHeader.GhiChu; }
            set
            {
                if (value == mh_YeuCauMuaHangHeader.GhiChu)
                    return;

                mh_YeuCauMuaHangHeader.GhiChu = value;

                base.OnPropertyChanged("GhiChu");
            }
        }
        public string TinhTrangTH
        {
            get { return mh_YeuCauMuaHangHeader.TinhTrangTH; }
            set
            {
                if (value == mh_YeuCauMuaHangHeader.TinhTrangTH)
                    return;

                mh_YeuCauMuaHangHeader.TinhTrangTH = value;

                base.OnPropertyChanged("TinhTrangTH");
            }
        }
        public string TinhTrang
        {
            get { return mh_YeuCauMuaHangHeader.TinhTrang; }
            set
            {
                if (value == mh_YeuCauMuaHangHeader.TinhTrang)
                    return;

                mh_YeuCauMuaHangHeader.TinhTrang = value;

                base.OnPropertyChanged("TinhTrang");
            }
        }

        public string FormName
        {
            get
            {
                return _FormName;
            }
            set
            {
                if (value == _FormName)
                    return;
                _FormName = value;
                base.OnPropertyChanged("FormName");
            }
        }
        #endregion
    }
     
}
